//Luis Carlos Vel�sqez 11085
//Diego Garcia 11360
package Sorts;

public class QuickSort{


static void Quicksort(int arr[], int p, int r){
if(p < r)
{
int q = pile(arr, p, r);
Quicksort(arr, p, q - 1);
Quicksort(arr, q + 1, r);
}
}

static int pile(int arr[], int p, int r){
int x = arr[r];
int i = p - 1, t;
for(int j = p; j < r; j++)
{
if(arr[j] <= x)
{
i++;
t = arr[i];
arr[i] = arr[j];
arr[j] = t;
}
}
t = arr[i + 1];
arr[i + 1] = arr[r];
arr[r] = t;
return i + 1;
}
}
